package adv2;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestBu {
    public static void main(String[] args) {
        int i=-14;
        String s=Integer.toBinaryString(i);
        System.out.println(s);
        System.out.println(Integer.toHexString(i));

        int j=-2147483648;
        int k=-j;
        System.out.println(k);
        //怎样直接表示二进制，和16进制，8进制
        // 0x,0,b
        int a=0b110;//6?
        int b=0x110;//?272
        int c=0110;//? 72
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);

        int start=0x4e00,end=0x9fa5;
        System.out.println(end-start+1);
        System.out.println(">>>>>>>>>>>>>>>>>>>>");

        int f=14;//1110
        int h=~f;
        System.out.println("h="+h);
        //>>,<<,  >>>
        f=f>>2;//除了几个2
        System.out.println("f移位后："+f);
        f=f<<3;//乘了几个2
        System.out.println("f左移后："+f);
        h=h>>1;
        System.out.println("h="+h);
        System.out.println();
        h=h>>>1;//无符号右移，最高位补0
        System.out.println(h);
    }
}
